package com.access.boot.autoconfigure.apisdk.aop;

/**
 * @author Yangzhen
 * @date 2022/6/2 14:18
 * @since 1.0.0
 */
class MethodBeforeAdviceAdapter implements AdvisorAdapter {

    @Override
    public boolean supportsAdvice(Advice advice) {
        return advice instanceof MethodBeforeAdvice;
    }

    @Override
    public MethodInterceptor getInterceptor(Advisor advisor) {
        MethodBeforeAdvice methodBeforeAdvice = (MethodBeforeAdvice) advisor.getAdvice();
        return new MethodBeforeAdviceInterceptor(methodBeforeAdvice);
    }
}
